<?php

namespace App\Common\Dao\System;

use App\Common\Dao\BaseDao;
use App\Model\CustomerPermissions;

class CustomerPermissionsDao extends BaseDao
{
    public function search(array $where)
    {
        return CustomerPermissions::when(isset($where['my_type']) && $where['my_type'] != '', function ($query) use ($where) {
            $query->where('my_type', $where['my_type']);
        })->when(isset($where['type']) && $where['type'] != '', function ($query) use ($where) {
            $query->whereIn('type', $where['type']);
        });
    }
    protected function getModel(): CustomerPermissions
    {
        return new CustomerPermissions();
    }
}